home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Revolution - Das Atari CD Magazin 1997
/
Revolution - Das Atari CD Magazin 1.iso
/
software
/
anwendng
/
qed_397
/
sourcen
/
comm.c
< prev
next >
Wrap
C/C++ Source or Header
|
1997-01-04
|
2KB
|
96 lines
#include "global.h"
#include "av.h"
#include "dd.h"
#include "magx.h"
#include "olga.h"
#include "se.h"
#include "comm.h"
/* exportierte Variablen *****************************************************/
GLOBAL UBYTE *global_str1,
*global_str2;
GLOBAL WORD msgbuff[8]; /* Buffer, den send_msg verschickt */
/*****************************************************************************/
GLOBAL VOID *malloc_global(LONG size)
{
VOID *r;
if (mint || magx)
r = Mxalloc(size, 0x0043);
else
r = Malloc(size);
return r;
}
GLOBAL BOOLEAN send_msg(WORD id)
{
WORD ret;
msgbuff[1] = gl_apid;
msgbuff[2] = 0;
ret = appl_write(id, (short) sizeof(msgbuff), msgbuff);
return (ret > 0);
}
GLOBAL VOID send_clip_change(VOID)
{
WORD d, i;
if ((av_shell_id >= 0) && (av_shell_status & 512)) /* Desktop informieren */
{
memset(msgbuff, 0, (WORD)sizeof(msgbuff));
msgbuff[0] = AV_PATH_UPDATE;
strcpy(global_str1, scrapdir);
*(UBYTE **) (msgbuff + 3) = global_str1;
send_msg(av_shell_id);
}
if (((appl_xgetinfo(10, &i, &d, &d, &d)) && ((i&0x00FF) >= 7)) /* gibts Broadcast? */
|| (magx >= 0x400))
{
memset(msgbuff, 0, (WORD)sizeof(msgbuff));
msgbuff[0] = SC_CHANGED; /* alle anderen Applikationen */
msgbuff[3] = 0x0002; /* Text */
msgbuff[4] = '.T';
msgbuff[5] = 'XT';
shel_write(7, 0, 0, (UBYTE *)&msgbuff, NULL);
}
}
GLOBAL VOID send_m_special(WORD mode, WORD app)
{
if (magx)
{
memset(msgbuff, 0, (WORD)sizeof(msgbuff));
msgbuff[0] = SM_M_SPECIAL;
msgbuff[4] = 'MA';
msgbuff[5] = 'GX';
msgbuff[6] = mode;
msgbuff[7] = app;
send_msg(appl_find("SCRENMGR"));
}
}
GLOBAL VOID init_comm(VOID)
{
global_str1 = malloc_global(256);
global_str2 = malloc_global(256);
init_av();
init_se();
init_olga();
}
GLOBAL VOID term_comm(VOID)
{
term_olga();
term_se();
term_av();
if (global_str1 != NULL)
Mfree(global_str1);
if (global_str2 != NULL)
Mfree(global_str2);
}